package chat.client;

import java.io.File;
import java.io.FileNotFoundException;
import java.rmi.RemoteException;

import chat.server.ChatServerApp;
import rmioverlay.client.ClientApp;
import rmioverlay.lib.users.User;
import rmioverlay.server.*;

public class ChatClientApp extends ClientApp<ServerAppInterface> {
	private static final long serialVersionUID = 3349419367636876622L;
	private GUI gui;
	
	protected ChatClientApp(GUI pGUI) throws RemoteException {
		super();
		this.gui = pGUI;
	}

	public <T>void receive(T pData) {
		this.gui.appendChat(pData.toString());
	}

	public void sendAll(String pMsg)
			throws RemoteException {
		try {
			this.getServer().<String>sendAll(pMsg);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}


}
